package com.wenli.lt.controller;


import com.wenli.lt.entity.Classes;
import com.wenli.lt.entity.College;
import com.wenli.lt.service.ICollectionsService;
import com.wenli.lt.service.ICollegeService;
import com.wenli.lt.util.CommonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lt
 * @since 2021-03-21
 */
@RestController
@Api(tags="学院接口")
@RequestMapping("college")
public class CollegeController {
    @Autowired
    ICollegeService iCollegeService;

    @PostMapping("/addCollege")
    @ApiOperation("新增学院")
    public CommonResponse addCollege(@RequestBody @ApiParam(name = "college", value = "学院") College college){
        if (iCollegeService.addCollege(college)){
            return new CommonResponse("新增成功");
        }else {
            return new CommonResponse(CommonResponse.ERROR_CODE,"新增出错,请联系管理员!");
        }
    }

//    @GetMapping("/getCollege")
//    @ApiOperation("查询学院")
//    public CommonResponse getGrade(){
//        return new CommonResponse(iCollegeService.getCollege());
//
//    }



}
